home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / thor / zapfiles.thor < prev   
Text File  |  1996-11-10  |  1KB  |  68 lines

  1. /*
  2. ** $VER: ZapFiles.thor 0.5 (16.9.94)
  3. ** 
  4. ** ZapFiles.thor  - Script that creates sysop script commands for zapping
  5. **                  selected files in the filedatabase window.
  6. **                  Will only work on ABBS/MBBS systems.
  7. **                  Author: Petter Nilsen
  8. **
  9. */
  10.  
  11. options results
  12.  
  13. EVE_DOCOMMAND = 11
  14.  
  15. p = ' ' || address() || ' ' || show('P',,)
  16. thorport = pos(' THOR.',p)
  17.  
  18. if thorport > 0 then thorport = word(substr(p,thorport+1),1)
  19. else
  20. do
  21.     say 'No THOR port found!'
  22.     exit 10
  23. end
  24. address(thorport)
  25.  
  26. if ~show('p', 'BBSREAD') then do
  27.     address command
  28.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  29.         "WaitForPort BBSREAD"
  30. end
  31.  
  32. address(thorport)
  33.  
  34. CURRENTBBS stem CURRENT
  35. if(rc ~= 0) then 
  36. do
  37.     REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  38.     exit
  39. end    
  40.  
  41. bbs = CURRENT.BBSNAME
  42.  
  43. GETFILELIST outstem LIST
  44. if(rc ~= 0) then
  45. do
  46.     if(rc = 5) then REQUESTNOTIFY TEXT '"Filedatabase window not open."' BT '"_Ok"'
  47.     if(rc = 6) then REQUESTNOTIFY TEXT '"No files selected."' BT '"_Ok"'
  48.     if(rc = 30) then REQUESTNOTIFY TEXT '"'THOR.LASTERROR'"' BT '"_Ok"'
  49.     exit
  50. end
  51.  
  52. address(BBSREAD)
  53.  
  54. do i=1 to LIST.COUNT
  55.     drop EVENT.
  56.  
  57.     EVENT.COMMANDSTRING = '! zap '||LIST.FILENAME.i||' y y'
  58.  
  59.     WRITEBREVENT bbsname '"'bbs'"' event EVE_DOCOMMAND stem EVENT
  60.     if(rc ~= 0) then 
  61.     do
  62.         address(thorport)
  63.         REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  64.         exit
  65.     end
  66. end
  67. exit
  68.